<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #canvas {
            border: 1px solid black;
        }
    </style>
</head>
<body>
<canvas width="600px" height="300px" id="canvas"></canvas>
<script>
    const canvas = document.querySelector("#canvas")
    const ctx = canvas.getContext("2d")

    ctx.rect(10, 10, 200, 100)  // 起点，宽高

    // 绘制空心的矩阵
    ctx.stroke()

    // 绘制实心的矩阵
    ctx.fillStyle = 'lightblue'
    ctx.fill()
</script>
</body>
</html>